import { Component, OnInit } from "@angular/core";

import { Store, select } from "@ngrx/store";
import * as fromUser from "@/user/store/reducers/index";
import * as fromTrade from "@/trade/store/reducers/index";
import * as fromAssets from "@/assets/store/reducers/index";
import * as fromRoot from "@/reducers/index";
import { map, filter, skip } from "rxjs/operators";
import { Subscription } from "rxjs";
import { AssetsActions } from "@/assets/store/actions";
import { FormControl } from "@angular/forms";
import { forkJoin, combineLatest, zip } from "rxjs";
import { combineAll, debounceTime } from "rxjs/operators";
import { Router, NavigationEnd } from "@angular/router";
import { ActivatedRoute } from "@angular/router";
import { ISelectAssetsRequest } from "@/assets/store/models/assets";

@Component({
  selector: "app-home",
  templateUrl: "./home.component.html",
  styleUrls: ["./home.component.scss"]
})
export class HomeComponent implements OnInit {
  req: ISelectAssetsRequest = {
    uid: "",
    search: "",
    hideSmall: false
  };

  user$ = this.store.pipe(
    select(fromRoot.user),
    filter(user => !!user)
  );

  constructor(
    private activatedRoute: ActivatedRoute,
    private store: Store<fromAssets.State | fromUser.State | fromRoot.State>
  ) {}

  ngOnInit() {}
}
